import request from '@/utils/request'

// 获取角色列表
export const getRoleList = (params) => request({
  url: '/sys/role',
  method: 'GET',
  params
})
// 获取公司信息
export const companyInfo = (companyId) => request({
  url: `/company/${companyId}`
})
// 删除角色
export const deleteRole = (id) => request({
  url: `/sys/role/${id}`,
  method: 'delete'
})
// 修改角色
export const updateRole = data => request({
  url: `/sys/role/${data.id}`,
  method: 'put',
  data
})
// 获取角色详情
export const getRoleDetail = id => request({
  url: `/sys/role/${id}`,
  method: 'GET'
})
// 新增
export const addRole = data => request({
  url: '/sys/role',
  method: 'POST',
  data
})
// 修改角色的权限
export const updateAuthRole = data => request({
  url: '/sys/role/assignPrem',
  method: 'PUT',
  data
})
